﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;

using Entity = VietStar.Library.Entity;
using Business = VietStar.Library.Business;

public partial class control_client_advertising : System.Web.UI.UserControl
{
    //Khai báo các biến cục bộ
    Entity.Banner entity = new Entity.Banner();
    Business.Banner business = new Business.Banner();
    private DataTable dsQuangCao = new DataTable();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadDanhSachQuangCao();
        }
    }
    //Load danh sách banner quảng cáo
    protected void LoadDanhSachQuangCao()
    {
        try
        {
            entity.TenViTri = "Quảng cáo";
            dsQuangCao = business.SelectBannerTemplates(entity);
            if (dsQuangCao.Rows.Count > 0)
            {
                rptDanhSachQuangCao.DataSource = dsQuangCao;
            }
            else
            {
                rptDanhSachQuangCao.DataSource = null;
            }
            rptDanhSachQuangCao.DataBind();
        }
        catch (Exception ex)
        { }
    }
}